<template>
	<view class="bgff pd pt20 pm20">
			
			<view class="pt10 pm10 display-flex fz30 z6">
				<view class="xczvrytxctrtr vertical-center tl">
					持卡人:
				</view>
				<view class="z3 flex-1">
						{{ret.realName||'--'}}
				</view>
			</view>
			<view class="pt10 pm10 display-flex fz30 z6">
				<view class="xczvrytxctrtr vertical-center tl">
					发薪卡名:
				</view>
				<view class="z3 flex-1">
					<input v-model="ret.payCardName" type="text" class="kxcxzrtrtxr pl20" placeholder="请输入发薪卡名" />
				</view>
			</view>
			<view class="pt10 pm10 display-flex fz30 z6">
				<view class="xczvrytxctrtr vertical-center tl">
					所属支行:
				</view>
				<view class="z3 flex-1">
					<input v-model="ret.payCardBranch" type="text" class="kxcxzrtrtxr pl20" placeholder="请输入所属支行" />
				</view>
			</view>
			
			<view class="pt10 pm10 display-flex fz30 z6">
				<view class="xczvrytxctrtr vertical-center tl">
					发薪卡号:
				</view>
				<view class="z3 flex-1">
					<input v-model="ret.payCard" type="text" class="kxcxzrtrtxr pl20" placeholder="请输入发薪卡号" />
				</view>
			</view>

	</view>
	
	
	<view class="mt100 pd">
		<button type="primary" class="fz32" @tap="bjhxdfrtx">提交</button>
	</view>
</template>
<script lang="ts" setup>
	import { ref } from "vue"
	import { hf, hfer, hfsan, dxrequest, VerifyTheLogin, upImg, yzphone,zidianall,callBack } from "@/util/index.js"
	import {onLoad} from "@dcloudio/uni-app"
	const ret = ref({})
	const getuser = async () => {
		const openid = uni.getStorageSync("openid")
		const { data } = await dxrequest("/api/user/" + openid)
		ret.value = data
	
	}
	getuser()
	
	const bjhxdfrtx = async()=>{
		if(!ret.value.payCardName){
			uni.showToast({
				title:"发薪卡名",
				icon:"none"
			})
			return
		}
		if(!ret.value.payCardBranch){
			uni.showToast({
				title:"所属支行",
				icon:"none"
			})
			return
		}
		if(!ret.value.payCard){
			uni.showToast({
				title:"发薪卡号",
				icon:"none"
			})
			return
		}
		
		const ksjd = await dxrequest("/api/user",ret.value,"put")
		if(ksjd.code==0){
			uni.showToast({
				title:"保存成功!"
			})
			callBack()
		}
	}
</script>

<style scoped>
</style>